<div id="cart"></div>
<link rel="stylesheet" type="text/css" href="<?php echo base_url(); ?>public/styles/jquery-ui.css" />
<link rel="stylesheet" type="text/css" href="<?php echo base_url(); ?>public/styles/tourdetail.css" />
<link rel="stylesheet" type="text/css" href="<?php echo base_url(); ?>public/styles/jquery.fancybox-1.3.4.css" />
<script type="text/javascript" src="<?php echo base_url(); ?>public/scripts/jquery-ui.js"></script>
<script type="text/javascript" src="<?php echo base_url(); ?>public/scripts/jquery.tn3lite.min.js"></script>
<script type="text/javascript" src="<?php echo base_url(); ?>public/scripts/jquery.reveal.js"></script>
<script type="text/javascript" src="<?php echo base_url(); ?>public/scripts/jquery.fancybox-1.3.4.pack.js"></script>
<script type="text/javascript" src="<?php echo base_url(); ?>public/scripts/detailcruise.js"></script>
<script type="text/javascript" src="<?php echo base_url(); ?>public/scripts/ajax.js"></script>
<div id="content">
    <div id="bodysite">
    	<div id="searchome">
        	<?php $this->load->view("public/msearch"); ?>
        </div>
        <div id="youhere">
        	You are here : <a href="<?php echo base_url() ?>" class="gray" title="Home">Home</a>&nbsp;&raquo;&nbsp;<a href="<?php echo base_url() ?>luxury-cruises.html" class="gray" title="Luxury cruises">Luxury cruises</a>&nbsp;&raquo;&nbsp;<a href="<?php echo base_url(); ?>your-cart.html" class="gray" title="Your cart">Your cart</a>
        </div>
        <?php if(isset($result['cruise_name'])){ ?>
    	<div id="tours">
        	<div id="toursl">
            	<h1><?php if(isset($result['cruise_name'])){echo $result['cruise_name'];}else{ echo "YOUR CART";}; ?></h1>
                <div id="ratings">
                	<div class="todays">
                    	<p>Day(s)</p>
						<p class="redbold">2 days / 3 days</p>
                    </div>
                    <div class="tocode">
                    	<p>Code</p>
						<p class="redbold"><?php echo $result['cruise_code']; ?></p>
                    </div>
                    <div class="torating">
                    	<p>Travellers rating</p>
                        <div class="hrating">
                            <div class="frati2 rating">
                            	<div class="rate_active" style="width:<?php echo ($result['cruise_rating']*13).'px' ?>;"></div>
                            </div>
                            <div class="frati3">
                            	<p class="redbold"><?php echo $result['cruise_rating']; ?>/5</p>
                            </div>
                            <div class="cls"></div>
                        </div>
                    </div>
                    <div class="toprice">
                    	<p>Price from</p>
                        <p class="redbold">$<?php echo $result['cruise_price']; ?></p>
                    </div>
                    <div class="cls"></div>
                    <div class="tograde">
                    	<p><span class="spangra">Grade : </span>
						<?php
                        for($i=0; $i<$result['cruise_star']; $i++){
                        ?>
                            <img src="<?php echo base_url(); ?>public/images/icon_duthuyen.png" class="grare" alt="" />
                        <?php }?>
                        <?php for($j=0; $j<5-$i;$j++){ ?>
                            <img src="<?php echo base_url(); ?>public/images/icon_duthuyen_hide.png" class="grare" alt="" />
                        <?php }?>
                        </p>
                    </div>
                    <div class="totype">
                    	Holiday type : <strong class="red">Luxury cruises</strong>
                    </div>
                    <div class="cls"></div>
                    <div class="conditions">
                    	<span class="red">*</span>
                    	<a class="aline" href="<?php echo base_url(); ?>terms.html" target="_blank" title="Booking conditions">Refer to booking conditions</a>
                    </div>
                </div>
                <div id="tourinfo"><?php echo $result['cruise_info']; ?></div>
            </div>
            <div id="toursr">
            	<div id="toslide">
                	<?php if($result['cruise_fullimg'] != NULL){ ?>
                    <div id="bigPic" style="width:433px;height:270px;position:relative;z-index:1">
                    <div id="pictitle">
                        <h3>haanhdon</h3>
                    </div>
                    <?php 
                        $forder = $result['cruise_forderimg'];
                        $listimage = unserialize($result['cruise_fullimg']);
                        if($listimage != NULL){
                            foreach($listimage as $image){
                                echo "<img src='".base_url()."uploads/cruises/$forder/".$image."' alt='".$result['cruise_name']."' title='".$result['cruise_name']."' width='433' height='270' />";
                            }
                        }
                    ?>
                    </div>
                    <ul id="thumb" style="width:433px">
                    <?php
                        $forder = $result['cruise_forderimg'];
                        $listimage = unserialize($result['cruise_fullimg']);
                        $st=1;
                        if($listimage != NULL){
                            foreach($listimage as $image){
                                $name = str_replace(".jpg","",$image);
                                $name = str_replace(".JPG","",$name);
                                $name = str_replace(".png","",$name);
                                $name = str_replace(".gif","",$name);
                                $name = str_replace(".PNG","",$name);
                                if($st == 1){
                                    echo "<li name='$name' style='margin-left:0px' class='active' rel='$st'><img class='thumim' src='".base_url()."uploads/cruises/$forder/".$image."' alt='$name' title='$name' /></li>";
                                }else{
                                    if($st <= 4){
                                        echo "<li rel='$st' name='$name'><img class='thumim' src='".base_url()."uploads/cruises/$forder/".$image."' alt='$name' title='$name' /></li>";
                                    }else{
                                        echo "<li style='display:none' rel='$st' name='$name'><img class='thumim' src='".base_url()."uploads/cruises/$forder/".$image."' alt='$name' title='$name' /></li>";
                                    }
                                }
                                $st++;
                            }
                        }
                    ?>
                    </ul>
                <?php } ?>
                </div>
                <div class="cls"></div>
            </div>
            <div class="cls"></div>
        </div>
        <?php } ?>
        <div id="infocruise">
        	<div id="showcart" style="margin-bottom:20px">
                <div id="steps">
                    <div class="stepsactive">
                        <div class="steps"><img src="<?php echo base_url(); ?>public/images/step1.png" width="38" height="35" alt="Halong bay cruise" class="imgstep" /><span class="stepspan red">Choose Your Cabins</span>
                        </div>
                    </div>
                    <div class="stepscontinue">
                        <div class="stepscon"><img src="<?php echo base_url(); ?>public/images/step2.png" width="38" height="35" alt="Halong bay cruise" class="imgstep" /><span class="stepspan">Select Transfer Services</span>
                        </div>
                    </div> 
                    <div class="step3">
                        <img src="<?php echo base_url(); ?>public/images/step3.png" width="38" height="35" alt="Halong bay cruise" class="imgstep" />	
                        <span class="">Payment</span>
                    </div> 
                    <div class="cls"></div>
                </div>
           </div>
           <div id="cartform">
            <form action="<?php echo base_url(); ?>home/cart/order" method="post" id="formcart">
                <table width="940" id="tb" cellspacing="0" cellpadding="0" >
                    <tr style="background:#c50000;height:40px">
                        <td width="299" style="font-size:12px;font-weight:bold;border-left:#c50000;color:#FFF">Cabin type</td>
                        <td width="109" style="text-align: center;font-size: 12px; font-weight: bold;color:#FFF">Unit</td>
                        <td width="84" style="text-align: center;font-size: 12px; font-weight: bold;color:#FFF">Rate</td>
                        <td width="42" style="text-align: center;font-size: 12px; font-weight: bold;color:#FFF">Amount</td>
                    </tr>
                    <?php
                    if(isset($_SESSION['rate'])){
                        $rate = $_SESSION['rate'];
                    }else{
                        $rate = "usd";
                    }
                    if($rate == "vnd"){
                        $typer = " VND";
                        echo "<input type='hidden' value='vnd' id='typep' />";
                    }else{
                        $typer = " USD";
                        echo "<input type='hidden' value='usd' id='typep' />";
                    }
                    if($this->cart->total_items()){
                        foreach($cart as $key => $value){
                    ?>
                    <tr >
                        <td style="border: solid 1px #d5d5d5;border-bottom:none;padding-bottom:15px">
                        <img src="<?php echo base_url()."uploads/rooms/thumb/".$value['options']['image']; ?>" alt="" align="left" style="margin-right:10px" width="120" height="75" />
                        <?php 
                            echo "<h3 class='red f15' style='padding:0px;margin:0px 0px 5px 0px'>".$value['name']."</h3>";
                            echo "<p class='inout'>Check-in : <span style='font-weight:bold'>".$value['options']['startdate']."</span></p>";
                            echo "<p class='inout'>Check-out : <span style='font-weight:bold'>".$value['options']['endate']."</span></p>";
                            echo "<span style='font-weight:bold'>";
                            if($value['options']['adults'] != 0){
                                if($value['options']['adults'] == 1){
                                    echo $value['options']['adults']." adult, ";
                                }else{
                                    echo $value['options']['adults']." adults, ";
                                }
                            }
                            if($value['options']['child'] != 0){
                                //echo $value['options']['child']." children ";
                                if($value['options']['child'] == 1){
                                    echo $value['options']['child']." child, ";
                                }else{
                                    echo $value['options']['child']." children, ";
                                }
                            }
                            if($value['options']['infants'] != 0){
                                //echo $value['options']['infants']." infants";
                                if($value['options']['infants'] == 1){
                                    echo $value['options']['infants']." infant ";
                                }else{
                                    echo $value['options']['infants']." infants ";
                                }
                            }
                            echo "</span>";
                        ?>
                            <a href="<?php echo base_url()."home/cart/del/".$value['id']; ?>" class="cart_del" style="float:right;color:#F00;font:12px">Delete</a>
                        </td>
                        <td style="border: solid 1px #d5d5d5; border-left: none;border-bottom:none;text-align: center;">
                            <?php 
                            $singler  = $value['options']['singler']; 
                            $doubler  = $value['options']['doubler']; 
                            $twinr    = $value['options']['twinr']; 
                            ?>
                            <?php if($value['options']['extra'] != 0){ echo $value['qty']; }else{ ?>
                            <p><?php if($singler != 0){echo $singler." single";} ?> </p>
                            <p><?php if($doubler != 0){echo $doubler." double";} ?> <?php if($twinr != 0){ echo $twinr." twin"; } ?></p>
                            <?php } ?>
                        </td>
                        <td style="border: solid 1px #d5d5d5; border-left: none;border-bottom:none; text-align: center;">
                        <?php 
                        if($value['options']['extra'] != 0 || $value['options']['extra'] != ""){ 
                            $priex = $value['options']['extra']*$value['options']['extrap'];
                            $priexshow = $value['price'] - $priex;
                        }else{
                            $priex = 0;
                            $priexshow = $value['price'];
                        }
                        ?>
                        <?php
                        if($value['options']['vat'] == 1){
                            $percen = round(($value['options']['price_vat']*10)/100);
                            $price  = $value['price'] - $percen;
                        }else{
                            $percen = "";
                            $price  = $value['price'];
                        }
                        ?>
                            <?php echo $priexshow.$typer; ?>
                        </td>
                        <td style="border: solid 1px #d5d5d5;border-left: none;border-bottom:none; text-align: center;">
                            <?php echo $priexshow.$typer; ?>
                        </td>
                    </tr>
                    <?php if($value['options']['extra'] != 0 || $value['options']['extra'] != ""){ ?>
                    <?php 
                        $priex = $value['options']['extra']*$value['options']['extrap'];
                        $priextra = $value['price'] - $priex;
                    ?>
                    <tr>
                        <td style="border: solid 1px #d5d5d5;border-bottom:none;padding:3px 10px;color:#F00;font-weight:bold"><p><input type="radio" disabled="disabled" style="margin-right:5px;">Extra Person</p></td>
                        <td style="border: solid 1px #d5d5d5; border-left: none;border-bottom:none;text-align: center;padding:0px 10px"><?php echo $value['options']['extra']; ?> Person</td>
                        <td style="border: solid 1px #d5d5d5; border-left: none;border-bottom:none;text-align: center;padding:0px 10px"><?php echo $value['options']['extrap'].$typer; ?></td>
                        <td style="border: solid 1px #d5d5d5; border-left: none;border-bottom:none;text-align: center;padding:0px 10px"><?php echo ($value['options']['extra']*$value['options']['extrap']).$typer; ?></td>
                    </tr>
                    <?php } ?>
                    <?php
                            if($value['options']['vat'] == 1){
                    ?>
                    <tr>
                        <td style="border: solid 1px #d5d5d5;border-bottom:none;padding:3px 10px"><p><input type="radio" disabled="disabled" style="margin-right:5px">VAT</p></td>
                        <td style="border: solid 1px #d5d5d5; border-left: none;border-bottom:none;text-align: center;padding:0px 10px">10%</td>
                        <td style="border: solid 1px #d5d5d5; border-left: none;border-bottom:none;text-align: center;padding:0px 10px">$<?php echo $percen; ?></td>
                        <td style="border: solid 1px #d5d5d5; border-left: none;border-bottom:none;text-align: center;padding:0px 10px">$<?php echo $percen; ?></td>
                    </tr>
                    <?php
                            }
                        }
                    ?>
                    <tr>
                        <td colspan="4" style="border:1px solid #d5d5d5;border-bottom:none;"></td>
                    </tr>
                    <tr>
                        <td colspan="4" style="border: solid 1px #d5d5d5; border-top:#d5d5d5;padding:0px 5px"><p><h2 style="font-weight:bold" class="red f20">Transfer Services (optional)</h2></p></td>
                        
                    </tr>
                    <?php
                    $adul = "";
                    $chil = "";
                    $infa = "";
                    $adulttransfer="";
                    $childtransfer="";
                    $svchild="";
                    if($adults  != 0){
                        if($adults == 1){
                            $adul = " adult"; 
                        }else{
                            $adul = " adults"; 
                        }
                    }
                    if($childs   != 0){ 
                        if($childs == 1){
                            $chil = " child "; 
                        }else{
                            $chil = " children"; 
                        }
                                //$chil = $items['options']['child']. " childs,"; 
                    }
                    if($infants != 0){ 
                        //$infa = $items['options']['infants']." infants "; 
                        if($infants == 1){
                            $infa = $infants." infant "; 
                        }else{
                            $infa = $infants." infants "; 
                        }
                    }
                    echo "<input type='hidden' name='totalservice' value='".count($services)."' />";
                    if(isset($services) && $services != NULL){
                    $st = 0;
                    foreach($services as $servi){
                        $st++;
                        if($rate == "vnd"){
                            $svchild = round($servi['service_child']*21000);
                            $ser_a = (($servi['service_adults']*$adults)+($servi['service_child']*$childs));
                            $ser_adult = round($servi['service_adults']*21000);
                            $ser_all = round($servi['service_all']*21000);
                        }else{
                            $ser_adult = $servi['service_adults'];
                            $ser_a = (($servi['service_adults']*$adults)+($servi['service_child']*$childs));
                            $ser_all = $servi['service_all'];
                            $svchild=$servi['service_child'];
                        }
                        if($adults != 0){
                            $adulttransfer="<select disabled='disabled' style='margin:0px 5px 3px 45px' pri='".$ser_adult."' rel='".$st."' class='adulttransfer' id='adulttransfer".$st."' name='adulttransfer".$st."'>";
                            for($i=0;$i<=$adults;$i++){
                                if($i==$adults)
                                    $adulttransfer.="<option value='$i' selected='selected' >$i</option>";
                                else
                                    $adulttransfer.="<option value='$i' >$i</option>";
                            }
                            $adulttransfer.="</select>";
                        }
                        if($childs != 0){
                            $childtransfer="<select disabled='disabled' style='margin:0px 5px 3px 45px' pri='".$svchild."' rel='".$st."' id='childtransfer".$st."' class='adulttransfer' name='childtransfer".$st."' >";
                            for($i=0;$i<=$childs;$i++){
                                if($i==$childs)
                                    $childtransfer.="<option value='$i' selected='selected' >$i</option>";
                                else
                                $childtransfer.="<option value='$i'>$i</option>";
                            }
                            $childtransfer.="</select>";
                        }
                        echo "<tr>";
                            if($servi['service_type'] == 0){
                                echo "<td class='service' style='padding:0px 10px;border:solid 1px #d5d5d5;border-top:none;border-right:none'><p><input type='checkbox' class='cartservice' id='service$st' name='service$st' alt='$st' value='".$ser_a."'
                                 style='margin-right:5px;' />".$servi['service_title']."</p><input type='hidden' name='servicetitle$st' value='".$servi['service_title']."' /><input type='hidden' name='serviceabc$st' value='".$servi['service_type']."' /><input type='hidden' name='priceadult$st'
                                  value='".$ser_adult."' /><input type='hidden' name='pricechild$st' value='".$svchild."' /></td>";
                                echo "<td style='padding:3px 5px 3px 25px;border:solid 1px #d5d5d5;border-top:none;border-right:none;'>".$adulttransfer.'<span id="spad'.$st.'">'.$adul.'</span>'."<br/>".$childtransfer.'<span id="spch'.$st.'">'.$chil.'</span>'."</td>";
                                echo "<td style='padding:3px 5px;border:solid 1px #d5d5d5;border-top:none;border-right:none;text-align:center;'>".$ser_adult.$typer."<br />";
                                if($value['options']['child'] != 0 && $value['options']['infants'] != 0){
                                   echo $svchild.$typer;
                                }
                                echo "</td>";
                                echo "<td style='padding:3px 5px;border:solid 1px #d5d5d5;border-top:none;text-align:center;'><span class='totalcount' id='price_service$st'>0".$typer."</span></td>";
                            }else{
                                echo "<td class='service brdt_none' style='padding:0px 10px;border:solid 1px #d5d5d5;border-top:none;border-right:none'><p><input type='checkbox' class='cartservice' name='service$st' alt='$st' value='".$ser_all."' style='margin-right:5px;' />".$servi['service_title']."</p>
                                <input type='hidden' name='servicetitle$st' value='".$servi['service_title']."' /><input type='hidden' name='serviceabc$st' value='".$servi['service_type']."' /></td>";
                                echo "<td style='padding:3px 5px;border:solid 1px #d5d5d5;border-top:none;border-right:none;text-align:center'>";
                                if($st ==2){echo 'Car';}
                                elseif($st == 3) {echo 'Bus';}
                                echo "</td>";
                                echo "<td style='padding:3px 5px;border:solid 1px #d5d5d5;border-top:none;border-right:none;text-align:center;'>".$ser_all.$typer."</td>";
                                echo "<td style='padding:3px 5px;border:solid 1px #d5d5d5;border-top:none;text-align:center;'><span class='totalcount' id='price_service$st'>0".$typer."</span></td>";
                            }
                        echo "</tr>";
                    }
                    }
                    ?>
                    <tr>
                        <td style="border: solid 1px #d5d5d5; border-top: none;border-right: none;">
                            <script type="text/javascript">
                            $(document).ready(function(){
                                $("#haanh").fancybox({
                                    'titlePosition'		: 'inside',
                                    'transitionIn'		: 'none',
                                    'transitionOut'		: 'none'
                                });
                            });
                            </script>
                            <h2 style="font-weight:bold" class="red f20">Extra Services</h2>
                            <input type="checkbox" style="margin-right:5px;" name="visa" id="visa" value="1" />Vietnam Visa Approval Letter (single entry) <a href="#inline1" id="haanh"><img src="<?php echo base_url(); ?>public/images/question.png" /></a>
                            <input type="hidden" name="totalprice" id="totalprice" value="<?php echo $this->cart->total(); ?>" />
                            <div style="display: none;">
                                <div id="inline1" style="width:600px;">
                                    <ul>  <li><strong>Notice of Vietnam visa on arrival for some sensitive  nationalities:</strong></li></ul><p>Please note that there will have  surcharge for some sensitive nationalities to get visa to Vietnam such as <strong>Iran, Iraq, Pakistan, India, Nepal, Turkey,  Quatar, Nigeria, etc....</strong></p><ul>  <li><strong>Vietnam  visa exemption</strong></li></ul><p>On 2013, Vietnam Visa Exemption  List has been updated frequently; therefore, please check for newest  application information Online.<br />  <br />  1. Vietnam Visa is exempted for <strong>Brunei</strong> passport holders within 14 days as from the date of arrival.<br />  <br />  2. Vietnam Visa is exempted for <strong>Thailand,  Malaysia, Singapore, Indonesia, Cambodia and Laos </strong>passport holders within  30 days as from the date of arrival.<br />  <br />  3. Vietnam Visa is exempted for <strong>Philippines</strong> passport holders within 21 days as from the date of arrival.<br />  <br />  4. Vietnam Visa is exempted for <strong>Japan,  South Korea, Sweden, Norway, Denmark, Russia and Finland</strong> passport holders  within 15 days as from the date of arrival.<br />  <br />  5. Vietnam Visa is exempted for <strong>France,  Chile </strong>citizens holding valid diplomatic or official passports within 90  days or several visits of 6 months as from the date of arrival.<br />  <br />  6. Vietnam Visa is exempted for <strong>APEC  Business Travel Card (ABTC)</strong> Holders from <strong>Asia-Pacific Economic Cooperation (APEC)</strong> member economies within 60  days as from the date of arrival.<br />  <br /></p>
                                </div>
                            </div>
                        </td>
                        <td style="border: solid 1px #d5d5d5; border-top: none;border-right: none;text-align: center;">
                            </br>
                            <?php
                            $total_person = $adults + $childs + $infants;
                            ?>
                            <select id="visanum" name="visanum" disabled="disabled">
                            <?php
                            for($i=1;$i<=$total_person;$i++){
                                echo "<option value='".$i."'>".$i."</option>";
                            }
                            ?>
                            </select> &nbsp;pax
                        </td>
                        <td style="border: solid 1px #d5d5d5; border-top: none;border-right: none;text-align: center;">
                            </br>
                            <?php if(isset($_SESSION['rate']) and $_SESSION['rate'] == "vnd"){echo "210000".$typer;}else{ echo "10".$typer;} ?> </td>
                        <td style="border: solid 1px #d5d5d5; border-top: none;text-align: center;padding-top:27px">
                            <span class='totalcount' id="visaprice">0<?php echo $typer; ?></span>
                        </td>
                    </tr>
                    <tr style="background:#f2f2f2;height:40px">
                        <td align="right" class="brdt_none"></td>
                        <td style="text-align: center;" class="brdt_none"><a href="<?php echo base_url()."home/cart/emptycart";?>" class="delall_cart" style="color:#1072ba;margin-left:0px">Empty cart</a></td>
                        <td style="text-align: center; color: #F00; font-size: 12px; font-weight: bold;" class="brdt_none">Total price</td>
                        <td style="text-align: center;color: #F00; font-size: 12px; font-weight: bold;" class="brdt_none"><span id="cart_total"><?php echo $this->cart->total().$typer; ?></span><a href="" name="<?php echo $this->cart->total(); ?>" id="firstprice" style="display:none">First price</a><!--a href="javascript:void(0)" class="continus">Continus</a--></td>
                    </tr>
                    <tr>
                      <td height="40" align="right" class="brdt_none" colspan="4" style="border:none">
                         <a href="javascript:void(0)" class="continus fr bder_rdus3 bder_820000 bold white bgr_c50000 h23 pdt7 pdr14 pdl14 mgt15">CONTINUE</a>
                      </td>
                  </tr>
                    <?php
                        }else{
                    ?>
                    <tr>
                        <td colspan="4" style="height:100px;color:#F00" align="center">Nothing in your shopping cart</td>
                    </tr>
                <?php
                    }
                ?>
                </table>
        	</form>
          </div>
        </div>
    </div>
</div>